﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Globalization;
using System.Data;
using System.Data.Common;
using System.Xml;
using System.Text;
using LibHuman;

namespace Human
{
	/// <summary>
	/// Summary description for frmGiaCanhSua.
	/// </summary>
	public class frmGiaCanh : System.Windows.Forms.Form
	{
		private string TSo="",sql="",m_user="";		
		private AccessData mDB=new AccessData();
        Language lan = new Language();
		public DataSet ds =new DataSet();
        int flag = 0;
        private bool admin = false;			
		private DataSet ds1=new DataSet();		
		private string v_manv,v_ho,v_bophan,ten_nd="";
		private System.Windows.Forms.Panel panCongTac;
		private System.Windows.Forms.Label lblTenPhongCT;
		private System.Windows.Forms.Label lblHoTenNVCT;
		private System.Windows.Forms.Label label29;
		private System.Windows.Forms.Label lblMasoNVCT;
        private System.Windows.Forms.Label label28;
		private System.Windows.Forms.TextBox txtGC_GC;
		private System.Windows.Forms.TextBox txtNS_GC;
		private System.Windows.Forms.ComboBox cboP_GC;
		private System.Windows.Forms.ComboBox cboQH_GC;
		private System.Windows.Forms.TextBox txtHT_GC;
		private System.Windows.Forms.Label label62;
		private System.Windows.Forms.Label label76;
		private System.Windows.Forms.Label label77;
		private System.Windows.Forms.Label label170;
		private System.Windows.Forms.Label label171;
		private System.Windows.Forms.TextBox txtDDGiaDinh;
		private System.Windows.Forms.Label label78;
		private System.Windows.Forms.CheckBox ckbGiaDinhLietSi;
		private System.Windows.Forms.CheckBox ckbTTHonNhan;
		private System.Windows.Forms.TextBox txtTSo;
		private System.Windows.Forms.Label label27;
		private System.Windows.Forms.Button butThem;
		private System.Windows.Forms.Button butHuy;
		private System.Windows.Forms.Button butKetThuc;
		private System.Windows.Forms.Button bboqua;
        private System.Windows.Forms.Button bthem;
        private Panel panel1;
        private TextBox txtId;
        private Button butEdit;
        private CheckBox chkBDXN;
        private CheckBox chkTNXP;
        private GroupBox grouptinhtrang;
        private TextBox txt_nn;
        private Label label1;
        private Label label2;
        private TextBox txtghichu;
        private DataGridView dataGridView1;
        private DataGridViewTextBoxColumn Column1;
        private DataGridViewTextBoxColumn Column2;
        private DataGridViewTextBoxColumn Column3;
        private DataGridViewTextBoxColumn Column4;
        private DataGridViewTextBoxColumn Column5;
        private DataGridViewTextBoxColumn Column11;
        private DataGridViewTextBoxColumn Column6;
        private DataGridViewTextBoxColumn Column7;
        private DataGridViewTextBoxColumn Column8;
        private DataGridViewTextBoxColumn Column9;
        private DataGridViewTextBoxColumn Column10;
        private DataGridViewTextBoxColumn id;
        private ToolTip toolTip1;
        private IContainer components;
        private CheckBox ckbgiadinhthuongbinh;
		private System.Windows.Forms.Button btn_xoa;
		//private System.ComponentModel.IContainer components;

		public frmGiaCanh(string manv,string hoten,string madv,bool m_admin,string tennd)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
            lan.Read_Language_to_Xml(this.Name.ToString(), this);
            lan.Changelanguage_to_English(this.Name.ToString(), this);
            m_user = mDB.user;
			lblMasoNVCT.Text=manv;
			lblHoTenNVCT.Text=hoten;
			lblTenPhongCT.Text=madv;			
			load_LBL();
			tongso();
            admin = m_admin;
            ten_nd = tennd;
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
//		protected override void Dispose( bool disposing )
//		{
//			if( disposing )
//			{
//				if(components != null)
//				{
//					components.Dispose();
//				}
//			}
//			base.Dispose( disposing );
//		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmGiaCanh));
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
            this.panCongTac = new System.Windows.Forms.Panel();
            this.lblTenPhongCT = new System.Windows.Forms.Label();
            this.lblHoTenNVCT = new System.Windows.Forms.Label();
            this.label29 = new System.Windows.Forms.Label();
            this.lblMasoNVCT = new System.Windows.Forms.Label();
            this.label28 = new System.Windows.Forms.Label();
            this.txtGC_GC = new System.Windows.Forms.TextBox();
            this.txtNS_GC = new System.Windows.Forms.TextBox();
            this.cboP_GC = new System.Windows.Forms.ComboBox();
            this.cboQH_GC = new System.Windows.Forms.ComboBox();
            this.txtHT_GC = new System.Windows.Forms.TextBox();
            this.label62 = new System.Windows.Forms.Label();
            this.label76 = new System.Windows.Forms.Label();
            this.label77 = new System.Windows.Forms.Label();
            this.label170 = new System.Windows.Forms.Label();
            this.label171 = new System.Windows.Forms.Label();
            this.txtDDGiaDinh = new System.Windows.Forms.TextBox();
            this.label78 = new System.Windows.Forms.Label();
            this.ckbGiaDinhLietSi = new System.Windows.Forms.CheckBox();
            this.ckbTTHonNhan = new System.Windows.Forms.CheckBox();
            this.txtTSo = new System.Windows.Forms.TextBox();
            this.label27 = new System.Windows.Forms.Label();
            this.bthem = new System.Windows.Forms.Button();
            this.btn_xoa = new System.Windows.Forms.Button();
            this.bboqua = new System.Windows.Forms.Button();
            this.butThem = new System.Windows.Forms.Button();
            this.butHuy = new System.Windows.Forms.Button();
            this.butKetThuc = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.butEdit = new System.Windows.Forms.Button();
            this.txtId = new System.Windows.Forms.TextBox();
            this.chkBDXN = new System.Windows.Forms.CheckBox();
            this.chkTNXP = new System.Windows.Forms.CheckBox();
            this.grouptinhtrang = new System.Windows.Forms.GroupBox();
            this.txt_nn = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.txtghichu = new System.Windows.Forms.TextBox();
            this.dataGridView1 = new System.Windows.Forms.DataGridView();
            this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.id = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
            this.ckbgiadinhthuongbinh = new System.Windows.Forms.CheckBox();
            this.panCongTac.SuspendLayout();
            this.panel1.SuspendLayout();
            this.grouptinhtrang.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
            this.SuspendLayout();
            // 
            // panCongTac
            // 
            this.panCongTac.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.panCongTac.Controls.Add(this.lblTenPhongCT);
            this.panCongTac.Controls.Add(this.lblHoTenNVCT);
            this.panCongTac.Controls.Add(this.label29);
            this.panCongTac.Controls.Add(this.lblMasoNVCT);
            this.panCongTac.Controls.Add(this.label28);
            this.panCongTac.Location = new System.Drawing.Point(2, 2);
            this.panCongTac.Name = "panCongTac";
            this.panCongTac.Size = new System.Drawing.Size(784, 40);
            this.panCongTac.TabIndex = 5;
            // 
            // lblTenPhongCT
            // 
            this.lblTenPhongCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblTenPhongCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblTenPhongCT.ForeColor = System.Drawing.Color.White;
            this.lblTenPhongCT.Location = new System.Drawing.Point(520, 0);
            this.lblTenPhongCT.Name = "lblTenPhongCT";
            this.lblTenPhongCT.Size = new System.Drawing.Size(264, 40);
            this.lblTenPhongCT.TabIndex = 4;
            this.lblTenPhongCT.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblHoTenNVCT
            // 
            this.lblHoTenNVCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblHoTenNVCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 13F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblHoTenNVCT.ForeColor = System.Drawing.Color.White;
            this.lblHoTenNVCT.Location = new System.Drawing.Point(232, 0);
            this.lblHoTenNVCT.Name = "lblHoTenNVCT";
            this.lblHoTenNVCT.Size = new System.Drawing.Size(288, 40);
            this.lblHoTenNVCT.TabIndex = 3;
            this.lblHoTenNVCT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label29
            // 
            this.label29.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label29.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label29.ForeColor = System.Drawing.Color.White;
            this.label29.Location = new System.Drawing.Point(176, 0);
            this.label29.Name = "label29";
            this.label29.Size = new System.Drawing.Size(56, 40);
            this.label29.TabIndex = 2;
            this.label29.Text = "Họ tên ";
            this.label29.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // lblMasoNVCT
            // 
            this.lblMasoNVCT.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.lblMasoNVCT.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblMasoNVCT.ForeColor = System.Drawing.Color.White;
            this.lblMasoNVCT.Location = new System.Drawing.Point(72, 0);
            this.lblMasoNVCT.Name = "lblMasoNVCT";
            this.lblMasoNVCT.Size = new System.Drawing.Size(80, 40);
            this.lblMasoNVCT.TabIndex = 1;
            this.lblMasoNVCT.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            // 
            // label28
            // 
            this.label28.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.label28.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label28.ForeColor = System.Drawing.Color.White;
            this.label28.Location = new System.Drawing.Point(15, 0);
            this.label28.Name = "label28";
            this.label28.Size = new System.Drawing.Size(61, 40);
            this.label28.TabIndex = 0;
            this.label28.Text = "Mã số ";
            this.label28.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // txtGC_GC
            // 
            this.txtGC_GC.BackColor = System.Drawing.SystemColors.HighlightText;
            this.txtGC_GC.Enabled = false;
            this.txtGC_GC.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtGC_GC.Location = new System.Drawing.Point(87, 480);
            this.txtGC_GC.MaxLength = 40;
            this.txtGC_GC.Name = "txtGC_GC";
            this.txtGC_GC.Size = new System.Drawing.Size(223, 20);
            this.txtGC_GC.TabIndex = 4;
            this.txtGC_GC.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtGC_GC_KeyDown);
            // 
            // txtNS_GC
            // 
            this.txtNS_GC.BackColor = System.Drawing.SystemColors.HighlightText;
            this.txtNS_GC.Enabled = false;
            this.txtNS_GC.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtNS_GC.Location = new System.Drawing.Point(626, 453);
            this.txtNS_GC.MaxLength = 4;
            this.txtNS_GC.Name = "txtNS_GC";
            this.txtNS_GC.Size = new System.Drawing.Size(76, 20);
            this.txtNS_GC.TabIndex = 3;
            this.txtNS_GC.Validated += new System.EventHandler(this.txtNS_GC_Validated);
            this.txtNS_GC.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtNS_GC_KeyDown);
            this.txtNS_GC.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtNS_GC_KeyPress);
            // 
            // cboP_GC
            // 
            this.cboP_GC.BackColor = System.Drawing.SystemColors.HighlightText;
            this.cboP_GC.Enabled = false;
            this.cboP_GC.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboP_GC.Location = new System.Drawing.Point(481, 452);
            this.cboP_GC.Name = "cboP_GC";
            this.cboP_GC.Size = new System.Drawing.Size(81, 21);
            this.cboP_GC.TabIndex = 2;
            this.cboP_GC.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboP_GC_KeyDown);
            // 
            // cboQH_GC
            // 
            this.cboQH_GC.BackColor = System.Drawing.SystemColors.HighlightText;
            this.cboQH_GC.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboQH_GC.Enabled = false;
            this.cboQH_GC.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cboQH_GC.Location = new System.Drawing.Point(87, 452);
            this.cboQH_GC.Name = "cboQH_GC";
            this.cboQH_GC.Size = new System.Drawing.Size(76, 21);
            this.cboQH_GC.TabIndex = 0;
            this.cboQH_GC.KeyDown += new System.Windows.Forms.KeyEventHandler(this.cboQH_GC_KeyDown);
            // 
            // txtHT_GC
            // 
            this.txtHT_GC.BackColor = System.Drawing.SystemColors.HighlightText;
            this.txtHT_GC.Enabled = false;
            this.txtHT_GC.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtHT_GC.Location = new System.Drawing.Point(219, 453);
            this.txtHT_GC.MaxLength = 30;
            this.txtHT_GC.Name = "txtHT_GC";
            this.txtHT_GC.Size = new System.Drawing.Size(223, 20);
            this.txtHT_GC.TabIndex = 1;
            this.txtHT_GC.Validated += new System.EventHandler(this.txtHT_GC_Validated);
            this.txtHT_GC.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtHT_GC_KeyDown);
            // 
            // label62
            // 
            this.label62.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label62.ForeColor = System.Drawing.Color.DarkBlue;
            this.label62.Location = new System.Drawing.Point(24, 484);
            this.label62.Name = "label62";
            this.label62.Size = new System.Drawing.Size(60, 13);
            this.label62.TabIndex = 57;
            this.label62.Text = "Quê quán :";
            this.label62.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label76
            // 
            this.label76.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label76.ForeColor = System.Drawing.Color.DarkBlue;
            this.label76.Location = new System.Drawing.Point(566, 456);
            this.label76.Name = "label76";
            this.label76.Size = new System.Drawing.Size(57, 13);
            this.label76.TabIndex = 55;
            this.label76.Text = "Năm sinh :";
            this.label76.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label77
            // 
            this.label77.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label77.ForeColor = System.Drawing.Color.DarkBlue;
            this.label77.Location = new System.Drawing.Point(445, 456);
            this.label77.Name = "label77";
            this.label77.Size = new System.Drawing.Size(34, 13);
            this.label77.TabIndex = 53;
            this.label77.Text = "Phái :";
            this.label77.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label170
            // 
            this.label170.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label170.ForeColor = System.Drawing.Color.DarkBlue;
            this.label170.Location = new System.Drawing.Point(30, 457);
            this.label170.Name = "label170";
            this.label170.Size = new System.Drawing.Size(54, 13);
            this.label170.TabIndex = 51;
            this.label170.Text = "Quan hệ :";
            this.label170.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label171
            // 
            this.label171.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label171.ForeColor = System.Drawing.Color.DarkBlue;
            this.label171.Location = new System.Drawing.Point(171, 456);
            this.label171.Name = "label171";
            this.label171.Size = new System.Drawing.Size(45, 13);
            this.label171.TabIndex = 49;
            this.label171.Text = "Họ tên :";
            this.label171.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // txtDDGiaDinh
            // 
            this.txtDDGiaDinh.Location = new System.Drawing.Point(442, 13);
            this.txtDDGiaDinh.MaxLength = 30;
            this.txtDDGiaDinh.Name = "txtDDGiaDinh";
            this.txtDDGiaDinh.Size = new System.Drawing.Size(324, 20);
            this.txtDDGiaDinh.TabIndex = 15;
            this.txtDDGiaDinh.Validated += new System.EventHandler(this.txtDDGiaDinh_Validated);
            this.txtDDGiaDinh.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtDDGiaDinh_KeyDown);
            // 
            // label78
            // 
            this.label78.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label78.ForeColor = System.Drawing.Color.DarkBlue;
            this.label78.Location = new System.Drawing.Point(304, 10);
            this.label78.Name = "label78";
            this.label78.Size = new System.Drawing.Size(120, 24);
            this.label78.TabIndex = 13;
            this.label78.Text = "Đặc điểm gia cảnh ";
            this.label78.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // ckbGiaDinhLietSi
            // 
            this.ckbGiaDinhLietSi.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.ckbGiaDinhLietSi.ForeColor = System.Drawing.Color.DarkBlue;
            this.ckbGiaDinhLietSi.Location = new System.Drawing.Point(169, 14);
            this.ckbGiaDinhLietSi.Name = "ckbGiaDinhLietSi";
            this.ckbGiaDinhLietSi.Size = new System.Drawing.Size(104, 24);
            this.ckbGiaDinhLietSi.TabIndex = 12;
            this.ckbGiaDinhLietSi.Text = "Gia đình liệt sĩ";
            this.ckbGiaDinhLietSi.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.ckbGiaDinhLietSi.CheckedChanged += new System.EventHandler(this.ckbGiaDinhLietSi_CheckedChanged);
            this.ckbGiaDinhLietSi.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ckbGiaDinhLietSi_KeyDown);
            // 
            // ckbTTHonNhan
            // 
            this.ckbTTHonNhan.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.ckbTTHonNhan.ForeColor = System.Drawing.Color.DarkBlue;
            this.ckbTTHonNhan.Location = new System.Drawing.Point(6, 14);
            this.ckbTTHonNhan.Name = "ckbTTHonNhan";
            this.ckbTTHonNhan.Size = new System.Drawing.Size(136, 24);
            this.ckbTTHonNhan.TabIndex = 11;
            this.ckbTTHonNhan.Text = "Tình trạng hôn nhân";
            this.ckbTTHonNhan.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.ckbTTHonNhan.CheckedChanged += new System.EventHandler(this.ckbTTHonNhan_CheckedChanged);
            this.ckbTTHonNhan.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ckbTTHonNhan_KeyDown);
            // 
            // txtTSo
            // 
            this.txtTSo.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtTSo.ForeColor = System.Drawing.Color.Red;
            this.txtTSo.Location = new System.Drawing.Point(74, 6);
            this.txtTSo.Name = "txtTSo";
            this.txtTSo.ReadOnly = true;
            this.txtTSo.Size = new System.Drawing.Size(64, 22);
            this.txtTSo.TabIndex = 101;
            this.txtTSo.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            this.txtTSo.WordWrap = false;
            // 
            // label27
            // 
            this.label27.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label27.ForeColor = System.Drawing.Color.Blue;
            this.label27.Location = new System.Drawing.Point(12, 5);
            this.label27.Name = "label27";
            this.label27.Size = new System.Drawing.Size(56, 24);
            this.label27.TabIndex = 103;
            this.label27.Text = "Tổng Số ";
            this.label27.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // bthem
            // 
            this.bthem.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.bthem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.bthem.Image = global::Human.Properties.Resources.add;
            this.bthem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.bthem.Location = new System.Drawing.Point(165, 4);
            this.bthem.Name = "bthem";
            this.bthem.Size = new System.Drawing.Size(65, 28);
            this.bthem.TabIndex = 8;
            this.bthem.Text = "    &Thêm";
            this.toolTip1.SetToolTip(this.bthem, "Alt+T");
            this.bthem.Click += new System.EventHandler(this.bthem_Click);
            // 
            // btn_xoa
            // 
            this.btn_xoa.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btn_xoa.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.btn_xoa.Image = global::Human.Properties.Resources.delete_enabled;
            this.btn_xoa.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.btn_xoa.Location = new System.Drawing.Point(307, 4);
            this.btn_xoa.Name = "btn_xoa";
            this.btn_xoa.Size = new System.Drawing.Size(65, 28);
            this.btn_xoa.TabIndex = 9;
            this.btn_xoa.Text = "   &Xoá";
            this.toolTip1.SetToolTip(this.btn_xoa, "Alt+X");
            this.btn_xoa.Click += new System.EventHandler(this.btn_xoa_Click);
            // 
            // bboqua
            // 
            this.bboqua.Enabled = false;
            this.bboqua.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.bboqua.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.bboqua.Image = ((System.Drawing.Image)(resources.GetObject("bboqua.Image")));
            this.bboqua.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.bboqua.Location = new System.Drawing.Point(450, 5);
            this.bboqua.Name = "bboqua";
            this.bboqua.Size = new System.Drawing.Size(70, 28);
            this.bboqua.TabIndex = 7;
            this.bboqua.Text = "&Bỏ qua";
            this.bboqua.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.toolTip1.SetToolTip(this.bboqua, "Alt+B");
            this.bboqua.Click += new System.EventHandler(this.bboqua_Click);
            // 
            // butThem
            // 
            this.butThem.Enabled = false;
            this.butThem.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butThem.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.butThem.Image = global::Human.Properties.Resources.save;
            this.butThem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butThem.Location = new System.Drawing.Point(379, 5);
            this.butThem.Name = "butThem";
            this.butThem.Size = new System.Drawing.Size(65, 28);
            this.butThem.TabIndex = 6;
            this.butThem.Text = "  &Lưu";
            this.toolTip1.SetToolTip(this.butThem, "Alt+L");
            this.butThem.Click += new System.EventHandler(this.butThem_Click);
            // 
            // butHuy
            // 
            this.butHuy.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butHuy.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.butHuy.Image = ((System.Drawing.Image)(resources.GetObject("butHuy.Image")));
            this.butHuy.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butHuy.Location = new System.Drawing.Point(526, 4);
            this.butHuy.Name = "butHuy";
            this.butHuy.Size = new System.Drawing.Size(65, 28);
            this.butHuy.TabIndex = 10;
            this.butHuy.Text = "   &Huỷ ";
            this.toolTip1.SetToolTip(this.butHuy, "Alt+H");
            this.butHuy.Click += new System.EventHandler(this.butHuy_Click);
            // 
            // butKetThuc
            // 
            this.butKetThuc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butKetThuc.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            this.butKetThuc.Image = global::Human.Properties.Resources.close_r;
            this.butKetThuc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butKetThuc.Location = new System.Drawing.Point(597, 4);
            this.butKetThuc.Name = "butKetThuc";
            this.butKetThuc.Size = new System.Drawing.Size(75, 28);
            this.butKetThuc.TabIndex = 11;
            this.butKetThuc.Text = "&Kết thúc";
            this.butKetThuc.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.toolTip1.SetToolTip(this.butKetThuc, "Alt+K");
            this.butKetThuc.Click += new System.EventHandler(this.butKetThuc_Click);
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.butEdit);
            this.panel1.Controls.Add(this.txtTSo);
            this.panel1.Controls.Add(this.label27);
            this.panel1.Controls.Add(this.butHuy);
            this.panel1.Controls.Add(this.butKetThuc);
            this.panel1.Controls.Add(this.bboqua);
            this.panel1.Controls.Add(this.butThem);
            this.panel1.Controls.Add(this.bthem);
            this.panel1.Controls.Add(this.btn_xoa);
            this.panel1.Location = new System.Drawing.Point(12, 506);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(690, 34);
            this.panel1.TabIndex = 106;
            // 
            // butEdit
            // 
            this.butEdit.BackColor = System.Drawing.SystemColors.Control;
            this.butEdit.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.butEdit.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(180)))));
            this.butEdit.Image = global::Human.Properties.Resources.quick_edit;
            this.butEdit.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
            this.butEdit.Location = new System.Drawing.Point(236, 4);
            this.butEdit.Name = "butEdit";
            this.butEdit.Size = new System.Drawing.Size(65, 28);
            this.butEdit.TabIndex = 105;
            this.butEdit.Text = "  &Sửa";
            this.toolTip1.SetToolTip(this.butEdit, "Alt+S");
            this.butEdit.UseVisualStyleBackColor = true;
            this.butEdit.Click += new System.EventHandler(this.butEdit_Click);
            // 
            // txtId
            // 
            this.txtId.Location = new System.Drawing.Point(107, 548);
            this.txtId.Name = "txtId";
            this.txtId.Size = new System.Drawing.Size(64, 20);
            this.txtId.TabIndex = 108;
            // 
            // chkBDXN
            // 
            this.chkBDXN.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.chkBDXN.ForeColor = System.Drawing.Color.DarkBlue;
            this.chkBDXN.Location = new System.Drawing.Point(680, 75);
            this.chkBDXN.Name = "chkBDXN";
            this.chkBDXN.Size = new System.Drawing.Size(56, 24);
            this.chkBDXN.TabIndex = 17;
            this.chkBDXN.Text = "Bộ đội xuất ngũ";
            this.chkBDXN.Visible = false;
            // 
            // chkTNXP
            // 
            this.chkTNXP.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.chkTNXP.ForeColor = System.Drawing.Color.DarkBlue;
            this.chkTNXP.Location = new System.Drawing.Point(705, 133);
            this.chkTNXP.Name = "chkTNXP";
            this.chkTNXP.Size = new System.Drawing.Size(48, 24);
            this.chkTNXP.TabIndex = 16;
            this.chkTNXP.Text = "Thanh niên xung phong";
            this.chkTNXP.Visible = false;
            // 
            // grouptinhtrang
            // 
            this.grouptinhtrang.Controls.Add(this.ckbgiadinhthuongbinh);
            this.grouptinhtrang.Controls.Add(this.ckbTTHonNhan);
            this.grouptinhtrang.Controls.Add(this.ckbGiaDinhLietSi);
            this.grouptinhtrang.Controls.Add(this.label78);
            this.grouptinhtrang.Controls.Add(this.txtDDGiaDinh);
            this.grouptinhtrang.Location = new System.Drawing.Point(12, 48);
            this.grouptinhtrang.Name = "grouptinhtrang";
            this.grouptinhtrang.Size = new System.Drawing.Size(774, 63);
            this.grouptinhtrang.TabIndex = 109;
            this.grouptinhtrang.TabStop = false;
            // 
            // txt_nn
            // 
            this.txt_nn.BackColor = System.Drawing.SystemColors.HighlightText;
            this.txt_nn.Enabled = false;
            this.txt_nn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txt_nn.Location = new System.Drawing.Point(391, 480);
            this.txt_nn.MaxLength = 40;
            this.txt_nn.Name = "txt_nn";
            this.txt_nn.Size = new System.Drawing.Size(171, 20);
            this.txt_nn.TabIndex = 5;
            this.txt_nn.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtGC_GC_KeyDown);
            // 
            // label1
            // 
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.ForeColor = System.Drawing.Color.DarkBlue;
            this.label1.Location = new System.Drawing.Point(315, 484);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(74, 13);
            this.label1.TabIndex = 111;
            this.label1.Text = "Nghề nghiệp :";
            this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // label2
            // 
            this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.Color.DarkBlue;
            this.label2.Location = new System.Drawing.Point(573, 483);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(50, 13);
            this.label2.TabIndex = 111;
            this.label2.Text = "Ghi chú :";
            this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // txtghichu
            // 
            this.txtghichu.BackColor = System.Drawing.SystemColors.HighlightText;
            this.txtghichu.Enabled = false;
            this.txtghichu.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.txtghichu.Location = new System.Drawing.Point(626, 479);
            this.txtghichu.MaxLength = 40;
            this.txtghichu.Name = "txtghichu";
            this.txtghichu.Size = new System.Drawing.Size(160, 20);
            this.txtghichu.TabIndex = 6;
            this.txtghichu.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtghichu_KeyDown);
            // 
            // dataGridView1
            // 
            this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
            this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle4.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
            this.dataGridView1.ColumnHeadersHeight = 25;
            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.Column1,
            this.Column2,
            this.Column3,
            this.Column4,
            this.Column5,
            this.Column11,
            this.Column6,
            this.Column7,
            this.Column8,
            this.Column9,
            this.Column10,
            this.id});
            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle5.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
            this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle5;
            this.dataGridView1.Location = new System.Drawing.Point(12, 117);
            this.dataGridView1.Name = "dataGridView1";
            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(160)))));
            dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
            this.dataGridView1.RowHeadersWidth = 25;
            this.dataGridView1.Size = new System.Drawing.Size(774, 323);
            this.dataGridView1.TabIndex = 107;
            this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
            // 
            // Column1
            // 
            this.Column1.DataPropertyName = "htendtg";
            this.Column1.HeaderText = "Họ tên";
            this.Column1.Name = "Column1";
            this.Column1.Width = 150;
            // 
            // Column2
            // 
            this.Column2.DataPropertyName = "tendt";
            this.Column2.HeaderText = "Quan hệ";
            this.Column2.Name = "Column2";
            this.Column2.Width = 80;
            // 
            // Column3
            // 
            this.Column3.DataPropertyName = "phai";
            this.Column3.HeaderText = "Phái";
            this.Column3.Name = "Column3";
            this.Column3.Width = 60;
            // 
            // Column4
            // 
            this.Column4.DataPropertyName = "namsinh";
            this.Column4.HeaderText = "Năm sinh";
            this.Column4.Name = "Column4";
            this.Column4.Width = 60;
            // 
            // Column5
            // 
            this.Column5.DataPropertyName = "quequan";
            this.Column5.HeaderText = "Quê quán";
            this.Column5.Name = "Column5";
            this.Column5.Width = 220;
            // 
            // Column11
            // 
            this.Column11.DataPropertyName = "nghenghiep";
            this.Column11.HeaderText = "Nghề nghiệp";
            this.Column11.Name = "Column11";
            this.Column11.Width = 180;
            // 
            // Column6
            // 
            this.Column6.DataPropertyName = "manv";
            this.Column6.HeaderText = "manv";
            this.Column6.Name = "Column6";
            this.Column6.Visible = false;
            // 
            // Column7
            // 
            this.Column7.DataPropertyName = "hoan_canh";
            this.Column7.HeaderText = "hoanh_canh";
            this.Column7.Name = "Column7";
            this.Column7.Visible = false;
            // 
            // Column8
            // 
            this.Column8.DataPropertyName = "lietsi";
            this.Column8.HeaderText = "lietsi";
            this.Column8.Name = "Column8";
            this.Column8.Visible = false;
            // 
            // Column9
            // 
            this.Column9.DataPropertyName = "dacdiem";
            this.Column9.HeaderText = "dacdiem";
            this.Column9.Name = "Column9";
            this.Column9.Visible = false;
            // 
            // Column10
            // 
            this.Column10.DataPropertyName = "madt";
            this.Column10.HeaderText = "madt";
            this.Column10.Name = "Column10";
            this.Column10.Visible = false;
            // 
            // id
            // 
            this.id.DataPropertyName = "id";
            this.id.HeaderText = "id";
            this.id.Name = "id";
            this.id.Visible = false;
            // 
            // ckbgiadinhthuongbinh
            // 
            this.ckbgiadinhthuongbinh.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.ckbgiadinhthuongbinh.ForeColor = System.Drawing.Color.DarkBlue;
            this.ckbgiadinhthuongbinh.Location = new System.Drawing.Point(169, 39);
            this.ckbgiadinhthuongbinh.Name = "ckbgiadinhthuongbinh";
            this.ckbgiadinhthuongbinh.Size = new System.Drawing.Size(132, 24);
            this.ckbgiadinhthuongbinh.TabIndex = 16;
            this.ckbgiadinhthuongbinh.Text = "Gia đình thương binh";
            this.ckbgiadinhthuongbinh.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.ckbgiadinhthuongbinh.CheckedChanged += new System.EventHandler(this.ckbgiadinhthuongbinh_CheckedChanged);
            // 
            // frmGiaCanh
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoScroll = true;
            this.ClientSize = new System.Drawing.Size(789, 571);
            this.Controls.Add(this.txtghichu);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.txt_nn);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.grouptinhtrang);
            this.Controls.Add(this.txtId);
            this.Controls.Add(this.dataGridView1);
            this.Controls.Add(this.txtGC_GC);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.panCongTac);
            this.Controls.Add(this.chkTNXP);
            this.Controls.Add(this.chkBDXN);
            this.Controls.Add(this.label170);
            this.Controls.Add(this.label77);
            this.Controls.Add(this.label171);
            this.Controls.Add(this.label62);
            this.Controls.Add(this.label76);
            this.Controls.Add(this.txtHT_GC);
            this.Controls.Add(this.cboP_GC);
            this.Controls.Add(this.txtNS_GC);
            this.Controls.Add(this.cboQH_GC);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "frmGiaCanh";
            this.ShowInTaskbar = false;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Hồ sơ nhân viên";
            this.Load += new System.EventHandler(this.frmGiaCanhSua_Load);
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.frmGiaCanh_KeyDown);
            this.panCongTac.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.grouptinhtrang.ResumeLayout(false);
            this.grouptinhtrang.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

		}
		#endregion


		
		private void Capnhat_gc()
		{
			string ma_nv,ddgc_gc;
			int gdls_gc,tthn_gc,gdtb_gc;
			ma_nv=lblMasoNVCT.Text;
			tthn_gc=(ckbTTHonNhan.Checked==true)?1:0;
			gdls_gc=(ckbGiaDinhLietSi.Checked==true)?1:0;
            gdtb_gc=(ckbgiadinhthuongbinh.Checked==true)?1:0;
			ddgc_gc=txtDDGiaDinh.Text;
			mDB.upd_giacanhllnv(ma_nv,gdls_gc,tthn_gc,gdtb_gc);//,v_bdxn,v_tnxp);
			mDB.upd_giacanhhopdong(ma_nv,ddgc_gc);
		}
		
		private void butThem_Click(object sender, System.EventArgs e)
		{
			try
			{
                if (txtNS_GC.Text.Trim() != "")
                {
                    tongso();
                    if (cboQH_GC.SelectedIndex != -1)
                    {
                        if (!kiemtragc()) return;
                        string ma_nv, ho_ten, quan_he, phai_, nam_sinh, que_quan,nghe_nghiep,ghichu;
                        decimal m_id = 0;                      
                                              
                        ma_nv = lblMasoNVCT.Text;
                        ho_ten = txtHT_GC.Text;
                        if (cboQH_GC.SelectedIndex == -1) cboQH_GC.SelectedIndex = 0;
                        quan_he = cboQH_GC.SelectedValue.ToString();
                        if (cboP_GC.SelectedIndex == -1) cboP_GC.SelectedIndex = 0;
                        phai_ = cboP_GC.SelectedValue.ToString();
                        nghe_nghiep = txt_nn.Text;
                        nam_sinh = txtNS_GC.Text;
                        que_quan = txtGC_GC.Text;
                        ghichu = txtghichu.Text;
                        if (flag == 0)
                        {
                            m_id = decimal.Parse(get_maxid());
                        }
                        else
                        {
                            if (txtId.Text != "")
                                m_id = decimal.Parse(txtId.Text.ToString());
                        }
                        mDB.upd_giacanh(m_id, ma_nv, ho_ten, quan_he, phai_, nam_sinh, que_quan,nghe_nghiep,ghichu,ten_nd);
                        load_grid_QHGD();
                    }
                    ena_control(true);
                    ena_text(false);                    
                    butKetThuc.Focus();
                    flag = 0;
                }
                else
                    txtNS_GC.Focus();
			}
			catch{}		
		}
		public void tongso()
		{
			try
			{
				ds=mDB.f_countNV();
				TSo=ds.Tables[0].Rows[0][0].ToString();
				txtTSo.Text="";
				txtTSo.Text=TSo.ToString();
			}
			catch{}
		}
		public string get_llnvmanv
		{
			get
			{
				v_manv=lblMasoNVCT.Text.ToString();				
				return v_manv;
			}
		}
		public string get_llnvmanv1
		{
			get
			{	
				v_ho=lblHoTenNVCT.Text.ToString();
				return v_ho;
			}
		}
		public string get_llnvmanv2
		{
			get
			{				
				v_bophan=lblTenPhongCT.Text.ToString();
				return v_bophan;
			}
		}
		private bool IsNumeric (string strNum)
		{	
			int iNum;
			try
			{
				iNum = int.Parse(strNum);
				return true;
			}
			catch
			{
				return false;
			}
		}
		
		private void load_LBL()
		{	
				load_giacanh();
				load_grid_QHGD();	
		}
		private void load_giacanh()
		{
			string ma_nv;
			try
			{
				ma_nv=lblMasoNVCT.Text;  
				DataSet ds=mDB.get_data("SELECT * from "+m_user+".llnv where mnvmay='"+ma_nv+"'") ;//.f_giacanh1(ma_nv);
				DataRow []r=ds.Tables[0].Select("mnvmay='"+ma_nv+"'");
                DataSet dshd = mDB.get_data("SELECT * from "+m_user+".hopdong where manv='" + ma_nv + "'"); //f_giacanh2(ma_nv);
				DataRow []rhd=dshd.Tables[0].Select("manv='"+ma_nv+"'");

				ckbTTHonNhan.Checked=r[0]["hoan_canh"].ToString()=="1";
				ckbGiaDinhLietSi.Checked=r[0]["lietsi"].ToString()=="1";
                ckbgiadinhthuongbinh.Checked = r[0]["thuongbinh"].ToString() == "1";
				chkBDXN.Checked=r[0]["bdxn"].ToString()=="1";
				chkTNXP.Checked=r[0]["tnxp"].ToString()=="1";
				txtDDGiaDinh.Text=rhd[0]["dacdiem"].ToString();
			}
			catch{}
		}
		private void load_giacanh(string v_manv,string v_ho,string v_bophan)
		{
			try
			{
				v_manv=get_llnvmanv;
				v_ho=get_llnvmanv1;
				v_bophan=get_llnvmanv2;
				if (lblMasoNVCT.Text.Trim()=="".ToString())
				{
					lblMasoNVCT.Text="00000";					
				}
				else
				{
					lblMasoNVCT.Text=v_manv;
					lblHoTenNVCT.Text=v_ho;
					lblTenPhongCT.Text=v_bophan;
					load_giacanh();									
				}
			}
			catch{}		
		}
		private void ckbTTHonNhan_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void ckbGiaDinhLietSi_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void txtDDGiaDinh_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void txtHT_GC_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}

		private void cboQH_GC_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
			{
				SendKeys.Send("{Tab}");				
			}
		}

		private void cboP_GC_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtNS_GC_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
				SendKeys.Send("{Tab}");
		}

		private void txtGC_GC_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			try
			{
				if (e.KeyCode==Keys.Enter)
				{
                    SendKeys.Send("{Tab}");								
				}
			}
			catch{}
		}
		private void cmdLuu_GC_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}{F4}");
		}
		
		private void txtNS_GC_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
            if ((e.KeyChar < '0' || e.KeyChar > '9') && e.KeyChar != '\b')
                e.KeyChar = '\0';
		}
		private void txtNS_GC_Validated(object sender, System.EventArgs e)
		{
			try
			{
				if(txtNS_GC.TextLength!=4)
				{
					txtNS_GC.Focus();
				}
				if(int.Parse(txtNS_GC.Text.ToString())>DateTime.Now.Year)
				{
					MessageBox.Show(lan.Change_language_MessageText("Không được lớn hơn năm hiện hành"),AccessData.Msg);
					txtNS_GC.Focus();
				}
			}
			catch{}
		}

		private bool kiemtragc()
		{
			if(txtHT_GC.Text=="")
			{
				MessageBox.Show(lan.Change_language_MessageText("Yêu cầu nhập họ tên"),AccessData.Msg);
				txtHT_GC.Focus();
				return false;
			}
			if(cboQH_GC.SelectedIndex==0 || cboQH_GC.SelectedIndex==2 ||
				cboQH_GC.SelectedIndex==4 || cboQH_GC.SelectedIndex==6 ||
				cboQH_GC.SelectedIndex==8 || cboQH_GC.SelectedIndex==13)
			{
				cboP_GC.SelectedIndex=0;
			}
			else if(cboQH_GC.SelectedIndex==1 || cboQH_GC.SelectedIndex==3 ||
				cboQH_GC.SelectedIndex==5 || cboQH_GC.SelectedIndex==7 ||
				cboQH_GC.SelectedIndex==9 || cboQH_GC.SelectedIndex==14)
			{
				cboP_GC.SelectedIndex=1;
			}
			if(txtNS_GC.Text=="" || txtNS_GC.TextLength > 4)
			{
				MessageBox.Show(lan.Change_language_MessageText("Nhập năm sinh không hợp lệ"),AccessData.Msg);
				txtNS_GC.Focus();				
				return false;
			}
			return true;
		}
		private void load_grid_QHGD()
		{
			try
			{
				string	ma_nv=lblMasoNVCT.Text;
                sql=" SELECT l.manv, l.hoan_canh, l.lietsi, h.dacdiem, ";
                sql+=" g.htendtg, g.madt, d.tendt, g.phai, g.namsinh, g.quequan,g.nghenghiep,g.id,g.ghichu ";
                sql += " FROM " + m_user + ".llnv l  INNER JOIN " + m_user + ".hopdong h ON l.manv=h.manv";
                sql += " INNER JOIN " + m_user + ".giacanh g on l.manv=g.manv";
                sql += " INNER JOIN " + m_user + ".doituong d ON g.madt=d.madt";
                sql += " inner join "+m_user+".max_lan ml on h.manv=ml.manv";
                sql+=" where l.manv='"+ma_nv+"' and h.lan=ml.lan ORDER BY g.madt ";
                DataSet ads = mDB.get_data(sql); //f_giacanh_QHGD(ma_nv);                
                dataGridView1.DataSource = ads.Tables[0];
				CurrencyManager cm = (CurrencyManager) BindingContext[dataGridView1.DataSource,dataGridView1.DataMember];
				DataView dv = (DataView) cm.List;
				dv.AllowDelete=false;
				dv.AllowNew=false;
				dv.AllowEdit=false;
			}
			catch{}
		}

		private void dataGridView1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode==Keys.Enter)
				SendKeys.Send("{Tab}");
		}
		
		private void goicb()
		{		
			ckbTTHonNhan.Checked=false;ckbGiaDinhLietSi.Checked=false;txtDDGiaDinh.Text="";
		}			

		private void butKetThuc_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void butHuy_Click(object sender, System.EventArgs e)
		{
			DataSet ds=new DataSet();
			string ma_nv=lblMasoNVCT.Text;
            int id = int.Parse(txtId.Text.ToString());
			DialogResult dr = MessageBox.Show(lan.Change_language_MessageText("Bạn có muốn hủy thông tin gia cảnh của nhân viên này không"),this.Text,MessageBoxButtons.YesNo,MessageBoxIcon.Question);			
			if(dr == DialogResult.Yes) 			
			{	
				try
				{
                    mDB.Execute_data("delete from "+m_user+".giacanh where manv='"+ma_nv+"'"); 
                    mDB.Execute_data("UPDATE " + m_user + ".llnv SET hoan_canh=0,lietsi=0 WHERE manv='" + ma_nv + "'"); 
                    mDB.Execute_data("UPDATE " + m_user + ".hopdong SET dacdiem='' WHERE manv='" + ma_nv + "'");
					MessageBox.Show("Đã Hủy");	
					ds=mDB.f_countNV();
					TSo=ds.Tables[0].Rows[0][0].ToString();
					txtTSo.Text="";
					txtTSo.Text=TSo.ToString();
					goicb();
					load_grid_QHGD();
                    ena_control(true);
                    
				}
				catch {}
			}
            flag = 0;
		}

		private void frmGiaCanhSua_Load(object sender, System.EventArgs e)
		{
			cboQH_GC.DisplayMember="tendt";
			cboQH_GC.ValueMember="madt";
            cboQH_GC.DataSource = mDB.get_doituong().Tables[0];

			cboP_GC.DisplayMember="ten";
			cboP_GC.ValueMember="ten";
            cboP_GC.DataSource = mDB.get_dmphai().Tables[0];
            txtId.Hide();
            grouptinhtrang.Enabled = false;
            ena_control(true);            
		}

		private void bthem_Click(object sender, System.EventArgs e)
		{
			ena_control(false);
            ena_text(true);
			txtHT_GC.Focus();			
			cboQH_GC.SelectedIndex=-1;cboP_GC.SelectedIndex=-1;
			txtHT_GC.Text="";txtNS_GC.Text="";
            grouptinhtrang.Enabled = true;
			SendKeys.Send("{F4}");
			cboQH_GC.Focus();
            flag = 0;
        }
        private string get_maxid()
        {
            decimal m_id = 0;
            sql = "select max(id)+1 as max_id from " + m_user + ".giacanh ";
            DataSet dst = new DataSet();
            try
            {
                dst = mDB.get_data(sql);
                if (dst.Tables[0].Rows[0]["max_id"].ToString() != "")
                {
                    m_id = decimal.Parse(dst.Tables[0].Rows[0]["max_id"].ToString());
                }
                else
                    m_id = 1;
            }
            catch
            {
                m_id = 1;
            }
            return m_id.ToString();
        }
		private void bboqua_Click(object sender, System.EventArgs e)
		{
			cboQH_GC.SelectedIndex=-1;cboP_GC.SelectedIndex=-1;
			txtHT_GC.Text="";txtNS_GC.Text="";txtGC_GC.Text="";			
			ena_control(true);
            grouptinhtrang.Enabled = false;
            bthem.Enabled = true;
            flag = 0;
		}

		private void ena_control(bool ena)
		{
			bthem.Enabled=ena;
			butThem.Enabled=!ena;
			bboqua.Enabled=!ena;
			butHuy.Enabled=!ena;
			btn_xoa.Enabled=!ena;
			butKetThuc.Enabled=ena;	
            butEdit.Enabled=!ena;
		}
        private void ena_text(bool ena)
        {
            cboQH_GC.Enabled = ena;
            txtghichu.Enabled = ena;
            txtHT_GC.Enabled = ena;
            txtGC_GC.Enabled = ena;
            txtNS_GC.Enabled = ena;
            cboP_GC.Enabled = ena;
            txt_nn.Enabled = ena;
        }
		
        private void ckbTTHonNhan_CheckedChanged(object sender, EventArgs e)
        {
            Capnhat_gc();
        }

        private void ckbGiaDinhLietSi_CheckedChanged(object sender, EventArgs e)
        {
            Capnhat_gc();
        }

        private void txtDDGiaDinh_Validated(object sender, EventArgs e)
        {
            Capnhat_gc();
        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string ma_nv, ho_ten, quan_he, phai_, nam_sinh, que_quan,nghe_nghiep;
            ma_nv = lblMasoNVCT.Text;
            try
            {
                DataRowView arv = (DataRowView)(dataGridView1.CurrentRow.DataBoundItem);
                ho_ten = arv["htendtg"].ToString(); //dataGridView1[i, 0].ToString();
                quan_he = arv["madt"].ToString();
                phai_ = arv["phai"].ToString();//dataGridView1[i, 3].ToString();
                nam_sinh = arv["namsinh"].ToString();
                que_quan = arv["quequan"].ToString();
                nghe_nghiep = arv["nghenghiep"].ToString();
                cboQH_GC.SelectedValue = quan_he;
                txtHT_GC.Text = ho_ten;
                txtNS_GC.Text = nam_sinh;
                cboP_GC.SelectedValue = phai_;
                txtGC_GC.Text = que_quan;
                txt_nn.Text = nghe_nghiep;
                txtId.Text = arv["id"].ToString();
                txtghichu.Text=arv["ghichu"].ToString();                
            }
            catch { }
            ena_control(false);
            butEdit.Enabled = admin;
            butHuy.Enabled = admin;
            btn_xoa.Enabled = admin;
            butKetThuc.Enabled = true;
        }

        private void txtHT_GC_Validated(object sender, EventArgs e)
        {
            if (txtHT_GC.Text!="")
                txtHT_GC.Text = mDB.Caps(txtHT_GC.Text.Trim());
        }
  
        private void butEdit_Click(object sender, EventArgs e)
        {
            ena_control(false);
            ena_text(true);
            grouptinhtrang.Enabled = true;
            bthem.Enabled = false;
            flag = 1;
        }
   
        private void txtghichu_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                butThem.Focus();
        }
        private void btn_xoa_Click(object sender, EventArgs e)
        {
            string ma_nv = "", m_quanhe = "";
            ena_text(true);
            ma_nv = lblMasoNVCT.Text;
            if (cboQH_GC.SelectedIndex != -1)
                m_quanhe = cboQH_GC.SelectedValue.ToString();
            else
            {
                MessageBox.Show(lan.Change_language_MessageText("Yêu cầu chọn thông tin để xóa!"), AccessData.Msg, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                dataGridView1.Focus();
                return;
            }
            sql = "DELETE  FROM  " + m_user + ".giacanh ";
            sql += " WHERE id=" + txtId.Text;

            try
            {

                DialogResult dr = MessageBox.Show(lan.Change_language_MessageText("Bạn có muốn hủy thành viên này không"), AccessData.Msg, MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    mDB.Execute_data(sql);
                    load_grid_QHGD();
                }
            }
            catch { }
            ena_control(true);
            flag = 0;
        }

        private void frmGiaCanh_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Alt && e.KeyCode == Keys.T)
            {
                bthem_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.S)
            {
                butEdit_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.H)
            {
                butHuy_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.X)
            {
                btn_xoa_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.L)
            {
                butThem_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.B)
            {
                bboqua_Click(null, null);
            }
            if (e.Alt && e.KeyCode == Keys.K)
            {
                butKetThuc_Click(null, null);
            }
        }

        private void ckbgiadinhthuongbinh_CheckedChanged(object sender, EventArgs e)
        {
            Capnhat_gc();
        }       
	}
}
